package com.example.sc.learn.service.api;

import com.example.sc.learn.entity.User;
import com.example.sc.learn.util.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(name = "sc-learn-user")
@Api(value = "用户",description = "用户接口")
public interface UserApi {

    @ApiOperation(value = "新增用户信息")
    @PostMapping("user")
    ResponseData<Boolean> insertUser(@RequestBody User user);



    @ApiOperation(value = "获取用户信息", notes = "根据用户编号")
    @ApiImplicitParam(name = "userCode",  value = "用户编号",  paramType = "path", required = true)
    @GetMapping("user/{userCode}")
    ResponseData<User> selectByUserCode(@PathVariable(value = "userCode") String userCode);




}
